package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author itcast
 */
@RestController("operationAgencyCertificationAuditController")
@RequestMapping("/operation/agency-certification-audit")
@Api(tags = "运营端 - 机构认证信息相关接口")
public class AgencyCertificationAuditController {

    @Resource
    private IAgencyCertificationAuditService agencyCertificationAuditService;

    /**
     * 机构认证审核分页查询
     * @param dto
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("机构认证审核分页查询")
    public PageResult<AgencyCertificationAuditResDTO> page(AgencyCertificationAuditPageQueryReqDTO dto) {
        return agencyCertificationAuditService.page(dto);
    }

    /**
     * 机构认证审核
     * @param id
     * @param rejectReason
     * @param certificationStatus
     */
    @PutMapping("/audit/{id}")
    public void audit(@PathVariable("id") Long id , @RequestParam("rejectReason") String rejectReason , @RequestParam("certificationStatus") Integer certificationStatus) {
        agencyCertificationAuditService.audit(id , rejectReason , certificationStatus);
    }



}
